package cn.wen.yaling.xo.service;

import cn.wen.yaling.commons.utils.ResultEntity;
import cn.wen.yaling.commons.vo.QuestionAddVO;
import cn.wen.yaling.commons.vo.QuestionListVO;
import cn.wen.yaling.commons.vo.QuestionUpdateVO;
import com.baomidou.mybatisplus.extension.service.IService;
import cn.wen.yaling.commons.utils.PageUtils;
import cn.wen.yaling.commons.entity.QuestionsEntity;

import java.util.List;
import java.util.Map;

/**
 * 
 *
 * @author FY
 * @email 932043654@qq.com
 * @date 2022-08-13 02:07:37
 */
public interface QuestionsService extends IService<QuestionsEntity> {

    PageUtils queryPage(Map<String, Object> params);

    /**
     * 获取全部激活的问题列表
     * @return
     */
    List<QuestionListVO> getAllIsActiveQuestionList();

    /**
     * 分布一个新贴
     * @param questionAddVO
     * @return
     */
    ResultEntity publishQuestion(QuestionAddVO questionAddVO, Integer typeId);

    /**
     * 通过浏览量来排序获取
     * @return
     */
    List<QuestionsEntity> getHotQuestionList();

    /**
     * 通过问答Id获取 问答的详细信息
     * @param questionId
     * @return
     */
    QuestionsEntity getQuestionInfoByQuestionId(Integer questionId);

    /**
     * 返回 所有还未删除的问答列表
     * @return
     */
    ResultEntity getAllNotDeleteQuestionList();


    ResultEntity addQuestion(QuestionAddVO question);

    /**
     * 更改问答信息
     * @param question
     * @return
     */
    ResultEntity updateQuestion(QuestionUpdateVO question);

    /**
     * 更新问答的状态
     * @param questionId
     * @param status
     * @return
     */
    ResultEntity updateQuestionStatus(Integer questionId, Integer status);

    /**
     * 修改改问答是否开启评论
     * @param questionId
     * @param isComment
     * @return
     */
    ResultEntity updateQuestionIsComment(Integer questionId, boolean isComment);

    /**
     * 查询问答信息
     * @param keyword
     * @return
     */
    ResultEntity searchAllNotDeleteQuestionList(String keyword);

    /**
     * 批量删除问答信息
     * @param questionIds
     * @return
     */
    ResultEntity deleteBatchQuestion(Integer[] questionIds);

    /**
     * 获取全部的问答分类
     * @return
     */
    ResultEntity getQuestionTypeList();

}

